
// See also Sun Bug 6800513

import javax.swing.*;

public class Test {
  public static void main(String[] args) {

    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);

        final JFrame w = new JFrame();
        final JMenuBar bar = new JMenuBar();
        final JMenu menu = new JMenu("File");

        for (int i = 0; i < 10; ++i) {
          menu.add(new JMenuItem("Menu Item #" + i));
        }

        bar.add(menu);

        w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        w.setJMenuBar(bar);
        w.pack();
        w.setVisible(true);
      }
    });
  }
}
